home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / x11 / rpg / crossfir.92 / crossfir / crossfire-0.92.5 / crossedit / App.h < prev    next >
C/C++ Source or Header  |  1996-07-24  |  4KB  |  136 lines

  1. /*
  2.     CrossEdit, A Editor for CrossFire, A Multiplayer game
  3.     for X-windows    
  4.  
  5.     Copyright (C) 1993 Jarkko Sonninen & Petri Heinila
  6.  
  7.     This program is free software; you can redistribute it and/or modify
  8.     it under the terms of the GNU General Public License as published by
  9.     the Free Software Foundation; either version 2 of the License, or
  10.     (at your option) any later version.
  11.  
  12.     This program is distributed in the hope that it will be useful,
  13.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.     GNU General Public License for more details.
  16.  
  17.     You should have received a copy of the GNU General Public License
  18.     along with this program; if not, write to the Free Software
  19.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.     
  21.     The authors can be reached via e-mail to Jarkko.Sonninen@lut.fi
  22.     or Petri.Heinila@lut.fi .
  23. */
  24.  
  25. #ifndef _App_h
  26. #define _App_h
  27.  
  28. #include "Defines.h"
  29. #include "Edit.h"
  30. #include "Cnv.h"
  31.  
  32. /**********************************************************************/
  33.  
  34. typedef struct {
  35.     Widget w;
  36.     char *name;
  37.     unsigned long flags;
  38. }   ArchFlagsRec;
  39.  
  40.  
  41. typedef struct {
  42.     Widget w;
  43.     unsigned long flags;
  44.     unsigned int all:1;
  45. }   Arch;
  46.  
  47. /*
  48.  * item to insert 
  49.  */
  50. typedef struct {
  51.     Widget w;            /* ??? */
  52.     Widget name;         /* name of insrted object */
  53.     Widget face;         /* inserted object looks like this */
  54.     Edit edit;           /* cloned object comes from this Edit */
  55.     object *clone;       /* clone this object */
  56.     int wall_set;        /* if wall use this set */
  57.     mapstruct *wall_map; /* if wall use this Map */
  58. }   Item;
  59. /*
  60.  * Item or area to look about
  61.  */
  62. typedef struct {
  63.     Widget w;        /* ??? */
  64.     Widget info;     /* ??? */
  65.     Widget menu;     /* ??? */
  66.     Edit edit;       /* last selected area fro this editor */
  67.     XRectangle rect; /* rectangle over selected area */
  68. }   Look;
  69.  
  70. /*
  71.  * Application Resources. Some can be setted by command line flags
  72.  */
  73. typedef struct {
  74.     Dimension mapWidth;  /* maximum width of shown map */
  75.     Dimension mapHeight; /* maximum height of shown map */
  76.     Boolean usePixmaps;  /* use pixmaps instead fonts */
  77.     Boolean useColorPixmaps;  /* use color pixmaps instead fonts */
  78.     String cmdCrossfire; /* to run crossfire */
  79.     String cmdReset;     /* to run reset on crossfire */
  80.     String cmdGoto;      /* to run goto on crossfire */
  81.     String creator;      /* user configurable own name */
  82.     String email;        /* user configurable internet address  */
  83. } AppRes;
  84.  
  85. /*
  86.  * Application domain data
  87.  */
  88. struct _App {
  89.     Display *display; /* user in this display */
  90.     Widget shell;     /* application level shell widget */
  91.     Edit edit;        /* list ofmap editors */
  92.     Edit clip;        /* clipboard (editor) */
  93.     unsigned int clipon:1;     /* is clipboard up */
  94.     Look look;        /* look part in application dialog */
  95.     Arch arch;        /* archetype list in application dialog */
  96.     Item item;        /* insertion item part in application dialog */
  97.     CnvPath path;     /* file selector */
  98.     AppRes res;       /* application resources */
  99.     Attr attr;        /* to edit objects attributes */
  100.     CnvFiles picks;   /* pick some objects */
  101.     CnvFiles walls;   /* pick some walls */
  102.     CnvFiles infof;   /* documentation files */
  103.     CnvBrowse info;   /* to show docs */
  104. };
  105.  
  106. extern Pixmap *pixmaps;       /* list of pixmaps */
  107.  
  108. /*
  109.  * Macro interface
  110.  */
  111. #define AppItemGetEdit(a) ((a)->item.edit)
  112. #define AppItemGetMap(a) ((a)->item.wall_map)
  113. #define AppItemGetWall(a) ((a)->item.wall_set)
  114. #define AppItemGetObject(a) ((a)->item.clone)
  115.  
  116. #define AppItemNoWall -1
  117.  
  118. /*
  119.  * Function interface
  120.  */
  121. extern App AppCreate ( XtAppContext appCon, String displayString, XtResource resources[], Cardinal resourcesNum, XrmOptionDescRec *options, Cardinal optionsNum, int *argc, char *argv[] );
  122. extern void AppDestroy ( App self );
  123. extern void AppUpdate ( App self );
  124. extern void AppSelectSet ( App self, Edit edit, XRectangle rect );
  125. extern void AppSelectUnset ( App self );
  126. extern void AppItemSet ( App self, Edit edit, object *obj, int wallSet );
  127. extern char PixelFromAlias ( char *name );
  128. extern void InitializeColors ( Display *dpy );
  129. extern Edit AppEditInsert ( App self, String path, EditType type );
  130. extern void AppEditAttach ( App self, Edit edit );
  131. extern void AppEditDeattach ( App self, Edit edit );
  132.  
  133. #endif /* _App_h */
  134.  
  135.  
  136.